<?php 
error_reporting(0);
include_once '../global-includes.php';
include_once "menu.php";

echo "<body bgcolor=$bgcolor>";

if ($_GET[id]) {
echo "<center><table cellpadding=3 width=500>";
echo "<tr><td colspan=4><font face=$title_face size=$title_size color=$title_color><b>Результати перевірки посилань</b></font><hr size=1></td></tr>";
echo "<tr><td align=center><font face=$font_face size=$font_size color=$font_color><b>Nick</b></font></td><td align=center><font face=$font_face size=$font_size color=$font_color><b>Категорія</b></font></td><td align=center><font face=$font_face size=$font_size color=$font_color><b>Посилання</b></font></td><td align=center><font face=$font_face size=$font_size color=$font_color><b>Результат</b></font></td></tr>";
$check_date = date("Y-m-d H:i:s");

$record = BaseDbService::execute_select_query("select  id, nick, category, htmltext, htmlimage, urllink, check_result, check_next, check_date FROM base WHERE id=$_GET[id]");
if ($record[0][id] == $_GET[id]) {
$a=$record[0][urllink];
$where =file("$a");
$where = implode($where, "\r\n");
if (strpos($where, "$myhome")) {
$check_result = ТАК;
$marker = time();
$days_code = 86400*$days_to_check;
$check_next = $marker+$days_code;
BaseDbService::execute_select_query("UPDATE base SET check_result='$check_result', check_next='$check_next', check_date='$check_date' WHERE id=$_GET[id]");
echo "<tr><td><font face=$font_face size=$font_size color=$font_color>".$record[0][nick]."</font></td><td><font face=$font_face size=$font_size color=$font_color>".$record[0][category]."</font></td><td><font face=$font_face size=$font_size color=$font_color><a href=".$record[0][urllink]." target=_blank>".$record[0][urllink]."</a></font></td><td align=center><font face=$font_face size=$font_size color=$font_color>$check_result</font></td></tr>";
} else {$check_result = НІ;
$marker = time();
$days_code = 86400*$days_to_check;
$check_next = $marker+$days_code;

BaseDbService::execute_select_query("UPDATE base SET check_result='$check_result', check_next='$check_next', check_date='$check_date' WHERE id=$_GET[id]");
echo "<tr><td><font face=$wrn_face size=$wrn_size color=$wrn_color>".$record[0][nick]."</font></td><td><font face=$wrn_face size=$wrn_size color=$wrn_color>".$record[0][category]."</font></td><td><font face=$wrn_face size=$wrn_size color=$wrn_color><a href=".$record[0][urllink]." target=_blank>".$record[0][urllink]."</a></font></td><td align=center><font face=$wrn_face size=$wrn_size color=$wrn_color>$check_result</font></td></tr>";
} 
}
echo "<tr><td colspan=4><hr size=1></td></tr>";
echo "</table></center>";
}

?>